{extend name="common/adminBase"}
{block name="body"}
<body>

<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">

                <div class="layui-card-header">
                    <button class="layui-btn" onclick="xadmin.open('添加Banner','/admin/WebConfig/addBanner',500,260)">
                        <i class="layui-icon"></i>添加Banner
                    </button>
                </div>
                <div class="layui-card-body ">
                    <table class="layui-table layui-form">
                        <thead>
                        <tr>
                            <th>ID</th>
                            <th>图片</th>
                            <th>添加时间</th>
                            <th>操作</th>
                        </thead>
                        <tbody>
                        {volist name="data" id="v"}
                        <tr>
                            <td>{$v.id}</td>
                            <td><img src="{$v.banner}" alt=""></td>
                            <td>{$v.time|date="Y-m-d"}</td>

                            <td class="td-manage">

                                <button class="layui-btn-danger layui-btn layui-btn-xs"  onclick="member_del({$v.id})" href="javascript:;" >
                                    <i class="layui-icon">&#xe640;</i>删除
                                </button>
                            </td>
                        </tr>
                        {/volist}
                        </tbody>
                    </table>
                </div>
                <div class="layui-card-body ">
                    <div class="page">
                        <div>

                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<script>
    layui.use('form', function(){
        var form = layui.form;

    });
    /*用户-删除*/
    function member_del(id){
        layer.confirm('您正在执行删除banner,请谨慎操作',function(index){
            $.ajax({
                url:'delBanner',
                data:{id:id},
                type:'post',
                dataType:'json',
                success:function (res) {
                    if (res.status ==1){
                        layer.msg(res.msg,{icon:1,time:1500},function () {
                            location.reload();
                        });
                    }else{
                        layer.alert(res.msg,function (index) {
                            layer.close(index);
                        })
                    }
                }
            })

        });
    }
</script>

{/block}